package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PubAichatMapper;
import com.ruoyi.system.domain.PubAichat;
import com.ruoyi.system.service.IPubAichatService;

/**
 * AI聊天Service业务层处理
 * 
 * @author gongxt
 * @date 2024-09-14
 */
@Service
public class PubAichatServiceImpl implements IPubAichatService 
{
    @Autowired
    private PubAichatMapper pubAichatMapper;

    /**
     * 查询AI聊天
     * 
     * @param id AI聊天主键
     * @return AI聊天
     */
    @Override
    public PubAichat selectPubAichatById(Long id)
    {
        return pubAichatMapper.selectPubAichatById(id);
    }

    /**
     * 查询AI聊天列表
     * 
     * @param pubAichat AI聊天
     * @return AI聊天
     */
    @Override
    public List<PubAichat> selectPubAichatList(PubAichat pubAichat)
    {
        return pubAichatMapper.selectPubAichatList(pubAichat);
    }

    /**
     * 新增AI聊天
     * 
     * @param pubAichat AI聊天
     * @return 结果
     */
    @Override
    public int insertPubAichat(PubAichat pubAichat)
    {
        pubAichat.setCreateTime(DateUtils.getNowDate());
        return pubAichatMapper.insertPubAichat(pubAichat);
    }

    /**
     * 修改AI聊天
     * 
     * @param pubAichat AI聊天
     * @return 结果
     */
    @Override
    public int updatePubAichat(PubAichat pubAichat)
    {
        return pubAichatMapper.updatePubAichat(pubAichat);
    }

    /**
     * 批量删除AI聊天
     * 
     * @param ids 需要删除的AI聊天主键
     * @return 结果
     */
    @Override
    public int deletePubAichatByIds(Long[] ids)
    {
        return pubAichatMapper.deletePubAichatByIds(ids);
    }

    /**
     * 删除AI聊天信息
     * 
     * @param id AI聊天主键
     * @return 结果
     */
    @Override
    public int deletePubAichatById(Long id)
    {
        return pubAichatMapper.deletePubAichatById(id);
    }
}
